package com.dhcc.cdc.webservice.config;

import com.dhcc.cdc.webservice.DataAccess;
import com.dhcc.cdc.webservice.DataAccessImpl;
import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.xml.ws.Endpoint;

@Configuration
public class CdcWebServiceConfig {
    @Autowired
    private SpringBus springBus;
	/** JAX-WS helloWorld**/
	@Bean
	public DataAccess dataAccess() {
		return new DataAccessImpl();
	}
	@Bean
	public Endpoint dataAccessEndpoint() {
		EndpointImpl endpoint = new EndpointImpl(springBus, dataAccess());
		endpoint.publish("/dataAccess");
		return endpoint;
	}
}